package com.winter.Controller;

import com.winter.service.OrderInfoService;
import com.winter.service.ReplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

@Controller
@RequestMapping(value = "/gunMan")
public class GunManController {

    private final OrderInfoService orderInfoService;
    @Autowired
    private ReplyService replyService;

    @Autowired
    public GunManController(OrderInfoService orderInfoService) {
        this.orderInfoService = orderInfoService;
    }

    //枪手接单
    @ResponseBody
    @RequestMapping(value = "/getOrder",produces = {"application/json;charset=UTF-8"})
    public void getOrder(Map<String,Object> paramMap){
        orderInfoService.getOrder(paramMap);
    }


    //检验枪手最多接单
    @ResponseBody
    @RequestMapping(value = "/checkGetOrder",produces = {"application/json;charset=UTF-8"})
    public String checkGetOrder(Map<String,Object> paramMap){
        return replyService.checkGetOrder(paramMap);
    }

    //枪手是否可以接单
    @ResponseBody
    @RequestMapping(value = "/checkGetOrderOwnMoney",produces = {"application/json;charset=UTF-8"})
    public String checkGetOrderOwnMoney(Map<String,Object> paramMap){
        return replyService.checkGetOrderOwnMoney(paramMap);
    }
}
